

#include<iostream>
#include<list>
#include<string>
#include<cmath>
#include<vector>
#include<fstream>
#include<ctime>
#include<windows.h>
using namespace std;
class Role;
class Monster;
class MonsterList;
class Mission;
class MissionList;
class Skill;
class SkillList;
class Using;
class UsingList;
class Weapon;
class WeaponList;
class NPC;
class NPCList;
class Map;
class MapList;
#define SLEEPTIME 900
extern  void ext_print_line();
#include"define.h"
#define PERCENT 1  /* percentOrNot is 1;*/
#define NOPERCENT 0  /* percentOrNot is 0*/


class Using{
private:
	int ID;
	string name;
	int money;
	int number;
	int addHitPoint;
	int addManaPoint;
	int percentOrNot;
public:
	int GetID();
	string GetName();
	int GetNumber();
	int GetPercentOrNot();
	int GetAddHitPoint();
	int GetAddManaPoint();
	int GetMoney();
	int SetName(string);
	int SetID(int);
	int SetNumber(int);
	int SetPercentOrNot(int);
	int SetAddHitPoint(int);
	int SetMoney(int);
	int SetAddManaPoint(int);
	int AddNumber(int);
	int AddNumber(int&,int);
	int PrintLessInfo();
	int PrintInfo(int in_npc_or_not = 0);
	/*is the using-thing used up? this function will give you an answer*/
	bool UseUp();
};

class UsingList
{
private:
	list<Using> usingList;
	list<Using>::iterator itr_using;
public:
	Using GetUsing(const int& );
	int PushUsing(Using );
	int GetSize();
	int InitItr();
	int Next();
	int End();
	Using GetCurUsing();
};

#include"gamecontrol.h"
int Using::GetID()
{
	return ID;
}
string Using::GetName()
{
	return name;
}
int Using::GetNumber()
{
	return number;
}
int Using::GetMoney()
{
	return money;
}
int Using::GetPercentOrNot()
{
	return percentOrNot;
}
int Using::GetAddHitPoint()
{
	return addHitPoint;
}
int Using::GetAddManaPoint() 
{
	return addManaPoint;
}

int Using::SetName(string n)
{
	name=n;
	return 1;
}
int Using::SetID(int id)
{
	ID=id;
	return ID;
}
int Using::SetMoney(int my)
{
	money = my;
	return my;
}
int Using::SetNumber(int num)
{
	number=num;
	return number;
}
int Using::SetPercentOrNot(int per)
{
	if(per!=1)
		per=0;
	percentOrNot=per;
	return percentOrNot;
}
int Using::SetAddHitPoint(int add)
{
	addHitPoint=add;
	return addHitPoint;
}
int Using::SetAddManaPoint(int add)
{
	addManaPoint=add;
	return addManaPoint;
}

int Using::AddNumber(int tag)
{
	++number;
	cout<<"你得到了: "<<name<<"*1"<<endl;
	if(tag==1)
		Sleep(SLEEPTIME);
	return number;
}
int Using::AddNumber(int& num,int tag)
{
	number=number+num;
	cout<<"你得到了: "<<name<<"*"<<num<<endl;
	if(tag==1)
		Sleep(SLEEPTIME);
	return number;
}
int Using::DecreaseNumber(int tag)
{
	if(number>0)
		--number;
	cout<<"你失去了: "<<name<<"*1"<<endl;
	if(tag==1)
		Sleep(SLEEPTIME);
	return number;
}
int Using::DecreaseNumber(int& num,int tag)/* sleep or not 0:no 1:yes*/
{
	if(number-num>=0)
		number=number-num;
	else
	{
		num=number;
		number=0;
	}
	cout<<"你失去了: "<<name<<"*"<<num<<endl;
	if(tag==1)
		Sleep(SLEEPTIME);
	return number;
}

/* 
 * print less of using , will work  when list the using
 */
int Using::PrintLessInfo()
{
	cout<<name;
	/* not the special thing*/
	if(addHitPoint!=0||addManaPoint!=0)
	{
		cout<<"(";
		if(addHitPoint!=0)
		{
			cout<<" HP:";
			if(percentOrNot==PERCENT)
				cout<<addHitPoint<<"% ";
			else
				cout<<addHitPoint<<" ";
		}
		if(addManaPoint!=0)
		{
			cout<<" MP:";
			if(percentOrNot==PERCENT)
				cout<<addManaPoint<<"% ";
			else
				cout<<addManaPoint<<" ";
		}
		cout<<")";
	}
	else
		cout<<"(物品)";
	cout<<"*"<<number<<endl;
	return 1;
}
/*
 * this function return three sorts of value:
 *		1:the role decide to use it
 *		0:the role do nothing about it
 *		-1:the role decide to thow out the using /(in shop ,role buy this 
 *					or sell this in shop.
 */
int Using::PrintInfo(int in_npc_or_not)
{
	string userinput;
	cout<<"-------------------物品信息------------------"<<endl;
	cout<<"名称: "<<name<<endl;
	cout<<"数量: "<<number<<endl;
	cout<<"价格: "<<money<<endl;
	cout<<"信息: ";
	if(addHitPoint!=0||addManaPoint!=0)/* not mission-need-special thing*/
	{
		cout<<"回复";
		if(addHitPoint!=0)
		{
			cout<<" 生命:";
			if(percentOrNot==PERCENT)
				cout<<(*this).addHitPoint<<"%";
			else
				cout<<(*this).addHitPoint;
		}
		if(addManaPoint!=0)
		{
			cout<<" 魔法:";
			if(percentOrNot==PERCENT)
				cout<<(*this).addManaPoint<<"%";
			else
				cout<<(*this).addManaPoint;
		}
	}
	else
		cout<<"平常物品";
	cout<<endl;
	cout<<"-----------------------------------------------"<<endl;
	if(in_npc_or_not == 1) /* buy in  shop .*/
	{
		cout<<"1:购买";
	}
	else if (in_npc_or_not == 2) /* sell in shop*/
	{
		cout<<"1:卖出";
	}
	else
	{
		cout<<"1:丢弃";
		if(addHitPoint!=0||addManaPoint!=0)
			cout<<"2:使用";
	}
	cout<<"0:返回"<<endl;
	for(int i=0;i<55;++i)
		cout<<'-';
	cout<<endl;
	while(true)
	{
		cin>>userinput;
		if(userinput[0]=='0')
			return 0;
		if(userinput[0]=='2'&&(addHitPoint!=0||addManaPoint!=0))
			return 1;
		if(userinput[0]=='1')
			return -1;
	}
}
/*is the using-thing used up? this function will give you an answer*/
bool Using::UseUp()
{
	if(number<=0)
		return true;
	else 
		return false;
}

Using UsingList::GetUsing(const int& id)
{
	for(itr_using=usingList.begin();itr_using!=usingList.end();++itr_using)
		if((*itr_using).GetID()==id)
			return (*itr_using);
		else
			continue;
	return *(usingList.begin());
}

int UsingList::PushUsing(Using use)
{
	/* usingid is the using's which want to add */
	int usingid=use.GetID();
	for(itr_using=usingList.begin();itr_using!=usingList.end();++itr_using)
		if((*itr_using).GetID()==usingid)
			return 0;
	usingList.push_back(use);
	return 1;
}
int UsingList::GetSize()
{
	return int(usingList.size());
}

int UsingList::InitItr()
{
	itr_using=usingList.begin();
	return 1;
}

int UsingList::Next()
{
	if(itr_using!=usingList.end())
	{
		++itr_using;
		return 1;
	}
	return 0;
}

int UsingList::End()
{
	if(itr_using!=usingList.end())
		return 0;
	return 1;
}

Using UsingList::GetCurUsing()
{
	return (*itr_using);
}

#include"use.h"
#define WEAPONWHITE 0
#define WEAPONYELLOW 1
#define WEAPONBLUE 2
#define WEAPONPURPLE 3
#define WEAPONHEAD 0
#define WEAPONUP 1
#define WEAPONDOWN 2
#define WEAPONFOOT 3
#define WEAPONHAND 4
#define WEAPONWEAPON 5

class Weapon
{
private:
	string name;
	int ID;
	int money;
	int colour;
	int level;
	int addAttackPoint;
	int addDefendPoint;
	int position;
public:
	string GetName();
	int GetID();
	int GetMoney();
	int GetColour();
	int GetLevel();
	int GetAddAttackPoint();
	int GetAddDefendPoint();
	int GetPosition();
	int SetName(string);
	int SetMoney(int);
	int SetID(int);
	int SetLevel(int);
	int SetColour(int);
	int SetAddAttackPoint(int);
	int SetAddDefendPoint(int);
	int SetPosition(int);  
	int Generate(const int& value = 0);
	int PrintLessInfo();
	int PrintInfo(const int&);
};

class WeaponList
{
private:
	list<Weapon> weaponList;
	list<Weapon>::iterator itr_weapon;
public:
	Weapon GetWeapon(int);
	int PushWeapon(Weapon );
	int GetNum();
	int InitItr();
	int End();
	int Next();
	Weapon GetCurWeapon();
};

# include"gamecontrol.h"
string Weapon::GetName()
{
	return name;
}
int Weapon::GetID()
{
	return ID;
}
int Weapon::GetMoney()
{
	return money;
}
int Weapon::GetColour()
{
	return colour;
}
int Weapon::GetLevel()
{
	return level;
}
int Weapon::GetAddAttackPoint()
{
	return addAttackPoint;
}
int Weapon::GetAddDefendPoint()
{
	return addDefendPoint;
}
int Weapon::GetPosition()
{
	return position;
}

int Weapon::SetName(string n)
{
	name=n;
	return 1;
}
int Weapon::SetMoney(int m)
{
	money=m;
	return money;
}
int Weapon::SetID(int id)
{
	ID= id;
	return ID;
}
int Weapon::SetColour(int co)
{
	colour=co;
	return colour;
}
int Weapon::SetLevel(int l)
{
	level=l;
	return level;
}
int Weapon::SetAddAttackPoint(int attack)
{
	addAttackPoint=attack;
	return addAttackPoint;
}
int Weapon::SetAddDefendPoint(int defend)
{
	addDefendPoint=defend;
	return addDefendPoint;
}
int Weapon::SetPosition(int p)
{
	position=p;
	return position;
}	purple: 1000%

int Weapon::Generate(const int& value)
{
	int temp;
	if(clr<6)/* purple*/
	{
		colour=WEAPONPURPLE;
		temp=rand()%20;
		addAttackPoint=int(float(addAttackPoint)*(temp+90)/100+float(addAttackPoint)*0.35);
		temp=rand()%20;
		addDefendPoint=int(float(addDefendPoint)*(temp+90)/100+float(addDefendPoint)*0.35);
		money=money*10;
	}
	else if(clr<16)/* blue*/
	{
		colour=WEAPONBLUE;
		temp=rand()%30;
		addAttackPoint=int(float(addAttackPoint)*(temp+85)/100+float(addAttackPoint)*0.2);
		temp=rand()%30;
		addDefendPoint=int(float(addDefendPoint)*(temp+85)/100+float(addDefendPoint)*0.2);
		money=money*6;
	}
	else if(clr<30) /* yellow*/
	{
		colour=WEAPONYELLOW;
		temp=rand()%20;
		addAttackPoint=int(float(addAttackPoint)*(temp+90)/100+float(addAttackPoint)*0.15);
		temp=rand()%20;
		addDefendPoint=int(float(addDefendPoint)*(temp+90)/100+float(addDefendPoint)*0.15);
		money=money*3;
	}
	else /* white */
	{
		colour=WEAPONWHITE;
		temp=rand()%20;
		addAttackPoint=int(float(addAttackPoint)*(temp+90)/100);
		temp=rand()%20;
		addDefendPoint=int(float(addDefendPoint)*(temp+90)/100);
	}
	return 1;
}

int Weapon::PrintLessInfo()
{
    
	cout<<name;
	if the colour is white ,dont need to add another info
	if(colour!=WEAPONWHITE)
	{
		cout<<"(";
		cout<<level<<"级,";
		switch(colour)
		{
		case WEAPONYELLOW:
			cout<<"黄";
			break;
		case WEAPONBLUE:
			cout<<"蓝";
			break;
		case WEAPONPURPLE:
			cout<<"紫";
			break;
		}
		cout<<")";
	}
	else
	{
		cout<<"("<<level<<"级)";
	}
	cout<<endl;
	return 1;
}

int Weapon::PrintInfo(const int& tag)
{
	string userinput;
	cout<<"-------------------装备信息-------------------"<<endl;
	cout<<"名称: "<<name<<endl;
	cout<<"等级: "<<level<<endl;
	cout<<"品质: ";
	switch(colour)
	{
	case WEAPONWHITE: 
		cout<<"普通"<<endl;
		break;
	case WEAPONYELLOW:
		cout<<"黄装"<<endl;
		break;
	case WEAPONBLUE:
		cout<<"蓝装"<<endl;
		break;
	case WEAPONPURPLE:
		cout<<"紫装(极品)"<<endl;
		break;
	}
	cout<<"类别: "; 
	switch(position)
	{
	case WEAPONHEAD :
		cout<<"头部"<<endl;
		break;
	case WEAPONUP:
		cout<<"上衣"<<endl;
		break;
	case WEAPONDOWN:
		cout<<"裤子"<<endl;
		break;
	case WEAPONHAND:
		cout<<"手套"<<endl;
		break;
	case WEAPONFOOT:
		cout<<"鞋子"<<endl;
		break;
	case WEAPONWEAPON:
		cout<<"武器"<<endl;
		break;
	}
	cout<<"攻击: "<<addAttackPoint<<endl;
	cout<<"防御: "<<addDefendPoint<<endl;
	cout<<"价格: "<<money<<endl;
	ext_print_line();
	if(tag==1)
	{
		/* in equipment*/
		cout<<" 1: 卸下装备0: 返回 "<<endl;
		for(int i=0;i<55;++i)
			cout<<'-';
		cout<<endl;
		while(true)
		{
			cin>>userinput;
			if(userinput[0]=='0')
				return 0;
			if(userinput[0]=='1')
				return -1;
		}
	}
	else if(tag==0)
	{
		/* in beg*/
		cout<<"1: 使用装备 2: 丢弃 0: 返回"<<endl;
		for(int i=0;i<55;++i)
			cout<<'-';
		cout<<endl;
		while(true)
		{
			cin>>userinput;
			if(userinput[0]=='0')
				return 0;
			if(userinput[0]=='1')
				return 1;
			if(userinput[0]=='2')
				return -1;
		}
	}
	else if(tag==2)
	{
		/* in npc*/
		cout<<"1:购买 0:返回"<<endl;
		for(int i=0;i<55;++i)
			cout<<'-';
		cout<<endl;
		while(true)
		{
			cin>>userinput;
			if(userinput[0]=='1')
				return 1;
			if(userinput[0]=='0')
				return 0;
		}
	}
	else if(tag==3)
	{
		/* sell weapon*/
		cout<<"1:卖出 0:返回"<<endl;
		for(int i=0;i<55;++i)
			cout<<'-';
		cout<<endl;
		while(true)
		{
			cin>>userinput;
			if(userinput[0]=='1')
				return 1;
			if(userinput[0]=='0')
				return 0;
		}
	}
	return 0;
}


#include"battle.h"
#define GAME_SAVE 0
#define GAME_LOAD 1
#define GAME_EXIT 2
#define GAME_INIT 3
#define GAME_NEW  4
#define GAME_INFO 5
#define GAME_MY   6
class GameControl
{
private:
	/* this is a label that stands for the game init,to make 
	 * sure that when in game user select to save ,thus go back
	 * to game, so the map should not init again, it is controled
	 * by this data.
	 */
	int init_time;
	/* the mission list */
	list<MissionBoss> missionBossList;
	list<MissionNpc> missionNpcList;
	list<MissionUsing> missionUsingList;
	/* there will be some part of function that stands for
	 * some special function.
	 */
	/* init the data in this game.
	 *   skill,monster,role,using,weapon,npc,map
	 *
	 * When some thing wrong in those part,function will return 
	 * -1 and the game will exit.
	 */
	int init_mission(MissionList&);
	int init_skill(SkillList&);
	int init_monster(MonsterList&);
	int init_role(Role&);
	int init_using(UsingList&);
	int init_weapon(WeaponList&);
	int init_npc(NPCList&);
	int init_map(MapList&);
public:
	GameControl();
	int game_init(Role& ,MapList& ,
		MonsterList& ,UsingList& ,
		WeaponList& ,MissionList& ,
		NPCList& ,SkillList& ,Battle& );
	int game_save();
	int game_load();

	int game_menu(Role& , MapList&, MonsterList&,
				 UsingList&, WeaponList&,
				 MissionList&,NPCList&,SkillList&);

	int print_game();
	int game_info();
	int my_game();
	/* show some *.txt files */
	int print_txt(char*);
};

#include"gamecontrol.h"
GameControl::GameControl()
{
	init_time = 1;
	/* clear the list of mission */
	(*this).missionBossList.clear();
	(*this).missionNpcList.clear();
	(*this).missionUsingList.clear();
}

int GameControl::init_mission(MissionList& missionlist)
{
	MissionUsing mission_use_tmp;
	mission_use_tmp.useList.clear();
	mission_use_tmp.useNum.clear();
	mission_use_tmp.SetID(400);
	mission_use_tmp.SetName("孟三的生意");
	mission_use_tmp.SetInfo("帮助孟三找到他需要的东西，他说好会有报酬的。");
	mission_use_tmp.SetState(0);
	mission_use_tmp.SetLock(1);
	mission_use_tmp.SetCircle(0);
	mission_use_tmp.SetLevel(1);
	mission_use_tmp.SetGiftType(3);
	mission_use_tmp.SetTalkBefore("少侠，我这生意是我们家的命，可是现在缺几样东西,\
能帮我找来么，我一定会答谢你的！");
	mission_use_tmp.SetTalkBeing("啊？还没找到啊，求你了，千万要帮帮我啊....");
	mission_use_tmp.SetTalkDone("上次的事情真是太感谢你了，\
要不然我这养家糊口的生意怕是做不成了.....");
	mission_use_tmp.PushGiftList(1);
	mission_use_tmp.PushGiftList(5);
	mission_use_tmp.PushGiftList(4);
	mission_use_tmp.PushGiftList(5);
	mission_use_tmp.useList.push_back(11);
	mission_use_tmp.useNum.push_back(3);
	mission_use_tmp.useNum.push_back(3);
	mission_use_tmp.useList.push_back(16);
	mission_use_tmp.SetUnlockMap(-1);
	missionUsingList.push_back(mission_use_tmp);

	mission_use_tmp.useList.clear();
	mission_use_tmp.useNum.clear();
	mission_use_tmp.SetID(401);
	mission_use_tmp.SetName("沈公子的拜托");
	mission_use_tmp.SetInfo("沈公子好像十分需要一些铁矿。");
	mission_use_tmp.SetState(0);
	mission_use_tmp.SetLock(1);
	mission_use_tmp.SetCircle(1);
	mission_use_tmp.SetLevel(1);
	mission_use_tmp.SetGiftType(3);
	mission_use_tmp.SetTalkBefore("哎呀，我需要打造一把上好剑鞘，可是少了铁，你方便的话\
帮我找点吧。");
	mission_use_tmp.SetTalkBeing("只要铁够了，剑鞘就会很快炼制成的。");
	mission_use_tmp.SetTalkDone("炼制剑鞘的事就多谢你了，日后定会报答！");
	mission_use_tmp.PushGiftList(2);
	mission_use_tmp.PushGiftList(4);
	mission_use_tmp.useList.push_back(12);
	mission_use_tmp.useNum.push_back(5);
	mission_use_tmp.SetUnlockMap(-1);
	missionUsingList.push_back(mission_use_tmp);
	
	mission_use_tmp.useList.clear();
	mission_use_tmp.useNum.clear();
	mission_use_tmp.SetID(406);
	mission_use_tmp.SetName("景阳的爱好");
	mission_use_tmp.SetInfo("听说景阳特别喜欢收集稀奇古怪的东西，比如虎牙、狼牙等。");
	mission_use_tmp.SetState(0);
	mission_use_tmp.SetLock(1);
	mission_use_tmp.SetCircle(0);
	mission_use_tmp.SetLevel(5);
	mission_use_tmp.SetGiftType(2);
	mission_use_tmp.SetTalkBefore("哈哈，我最喜欢古怪的东西，如果你能给我些虎牙，我会把我的剑送给你！");
	mission_use_tmp.SetTalkBeing("还没收集到啊，我都快等的急死了。");
	mission_use_tmp.SetTalkDone("虎牙你都能弄到，真厉害，希望那把剑能给你带来好运！");
	mission_use_tmp.PushGiftList(101);
	mission_use_tmp.useList.push_back(17);
	mission_use_tmp.useNum.push_back(10);
	mission_use_tmp.SetUnlockMap(-1);
	missionUsingList.push_back(mission_use_tmp);
	
	mission_use_tmp.useList.clear();
	mission_use_tmp.useNum.clear();
	mission_use_tmp.SetID(411);
	mission_use_tmp.SetName("威严的邢捕头");
	mission_use_tmp.SetInfo("邢捕头非常痛恨怪物，以至于非要收集怪物的脚去焚烧才解心头只恨...");
	mission_use_tmp.SetState(0);
	mission_use_tmp.SetLock(1);
	mission_use_tmp.SetCircle(0);
	mission_use_tmp.SetLevel(10);
	mission_use_tmp.SetGiftType(2);
	mission_use_tmp.SetTalkBefore("年轻人，听说你身法不错，那你给我去砍些怪物的蹄子给我，我会给你报酬的！");
	mission_use_tmp.SetTalkBeing("不把怪物的蹄子烧干净，我誓不罢休！");
	mission_use_tmp.SetTalkDone("上次的事情做得不错，希望你继续努力，为百姓除害！");
	mission_use_tmp.PushGiftList(107);
	mission_use_tmp.useList.push_back(14);
	mission_use_tmp.useNum.push_back(5);
	mission_use_tmp.SetUnlockMap(-1);
	missionUsingList.push_back(mission_use_tmp);

	MissionNpc mission_npc_tmp;
	mission_npc_tmp.ClearGiftList();
	mission_npc_tmp.SetID(402);
	mission_npc_tmp.SetName("传送加急的信件(一)");
	mission_npc_tmp.SetInfo("孟三好像非常迫切的去送信，去帮他吧。");
	mission_npc_tmp.SetLock(1);
	mission_npc_tmp.SetState(0);
	mission_npc_tmp.SetLevel(3);
	mission_npc_tmp.SetCircle(0);
	mission_npc_tmp.SetGiftType(1);
	mission_npc_tmp.PushGiftList(405);
	mission_npc_tmp.SetTalkBefore("我的哥哥孟良在后山挺长时间了，能帮我把这封信送过去么，我们已经好长\
时间没联系过了。");
	mission_npc_tmp.SetTalkBeing("信送到了么？哥哥他怎么样？还好吧？");
	mission_npc_tmp.SetTalkDone("少侠，你真是个热心肠的人啊。");
	mission_npc_tmp.SetUnlockMap(604);
	mission_npc_tmp.SetNpcID1(303);
	mission_npc_tmp.SetNpcID2(307);
	mission_npc_tmp.SetMapID(0);
	missionNpcList.push_back(mission_npc_tmp);
	
	mission_npc_tmp.ClearGiftList();
	mission_npc_tmp.SetID(405);
	mission_npc_tmp.SetName("传送加急的信件(二)");
	mission_npc_tmp.SetInfo("孟三的哥哥孟良找他弟弟好像有什么事，这封信件好像很重要吧。");
	mission_npc_tmp.SetLock(0);
	mission_npc_tmp.SetState(0);
	mission_npc_tmp.SetLevel(3);
	mission_npc_tmp.SetCircle(0);
	mission_npc_tmp.SetGiftType(0);
	mission_npc_tmp.PushGiftList(100);
	mission_npc_tmp.SetTalkBefore("少侠，拜托你，把这封信送给我弟弟，后山有重要的事发生了。");
	mission_npc_tmp.SetTalkBeing("希望弟弟看到后不要担心啊。");
	mission_npc_tmp.SetTalkDone("送信的事情谢谢你了，你真是个好心人！");
	mission_npc_tmp.SetUnlockMap(-1);
	mission_npc_tmp.SetNpcID1(307);
	mission_npc_tmp.SetNpcID2(303);
	mission_npc_tmp.SetMapID(0);
	missionNpcList.push_back(mission_npc_tmp);
	
	mission_npc_tmp.ClearGiftList();
	mission_npc_tmp.SetID(404);
	mission_npc_tmp.SetName("踏上征途");
	mission_npc_tmp.SetInfo("村里的事情已经平息了，你已经积累了足够的经验和技巧，那么，就向着更广阔的\
世界前进吧！去洛阳找邢捕头，他会告诉你些什么的。");
	mission_npc_tmp.SetLock(0);
	mission_npc_tmp.SetState(0);
	mission_npc_tmp.SetLevel(5);
	mission_npc_tmp.SetCircle(0);
	mission_npc_tmp.SetGiftType(1);
	mission_npc_tmp.PushGiftList(407);
	mission_npc_tmp.SetTalkBefore("镇上的事情多亏大侠帮助了，我代表本镇谢谢大侠了，听说洛阳那边出现了\
怪物，大侠要是有心就去那看看吧，那儿的人们遭受怪物折磨很久了。你往东部\
走就行了，邢捕头会和你交谈的。");
	mission_npc_tmp.SetTalkBeing("哎...天下苍生，还要被怪物折磨多久啊....");
	mission_npc_tmp.SetTalkDone("小伙子，娄知县就是说得你呀，挺精神的。这就是洛阳了，不过这\
								里怪物横生，你还是小心点吧。");
	mission_npc_tmp.SetUnlockMap(609);
	mission_npc_tmp.SetNpcID1(305);
	mission_npc_tmp.SetNpcID2(309);
	mission_npc_tmp.SetMapID(0);
	missionNpcList.push_back(mission_npc_tmp);
	
	mission_npc_tmp.ClearGiftList();
	mission_npc_tmp.SetID(410);
	mission_npc_tmp.SetName("兴奋的宋书生");
	mission_npc_tmp.SetInfo("洛阳的宋书生说如果帮他找到太白仙人，他就一定会中举的，不知能不能找到。");
	mission_npc_tmp.SetLock(1);
	mission_npc_tmp.SetState(0);
	mission_npc_tmp.SetLevel(10);
	mission_npc_tmp.SetCircle(0);
	mission_npc_tmp.SetGiftType(2);
	mission_npc_tmp.PushGiftList(103);
	mission_npc_tmp.SetTalkBefore("啊，昨晚梦见一个神秘的太白仙人，说如果白天能还见到他，我就会中举！如果你\
看到了，一定要给我说一声啊！");
	mission_npc_tmp.SetTalkBeing("如果真的找到这位仙人，我寒窗苦读十几年就要有回报了！");
	mission_npc_tmp.SetTalkDone("啊？你真的找到了？真不敢相信！书生在这写过侠客了！");
	mission_npc_tmp.SetUnlockMap(-1);
	mission_npc_tmp.SetNpcID1(311);
	mission_npc_tmp.SetNpcID2(308);
	mission_npc_tmp.SetMapID(0);
	missionNpcList.push_back(mission_npc_tmp);

	MissionBoss mission_boss_tmp;
	mission_boss_tmp.ClearGiftList();
	mission_boss_tmp.SetID(403);
	mission_boss_tmp.SetName("为祸人间的山妖");
	mission_boss_tmp.SetInfo("瓦当镇的后山深处有一山妖，危害镇民，传闻此山妖厉害无比，一般人不敢靠近。");
	mission_boss_tmp.SetLock(1);
	mission_boss_tmp.SetState(0);
	mission_boss_tmp.SetLevel(3);
	mission_boss_tmp.SetCircle(0);
	mission_boss_tmp.SetGiftType(1);
	mission_boss_tmp.PushGiftList(404);
	mission_boss_tmp.SetUnlockMap(607);
	mission_boss_tmp.PushBossID(851);
	mission_boss_tmp.SetTalkBefore("哎...后山的山妖把镇民们的田地都破坏了，还抓走了小孩，现在\
都没人去后山了，希望少侠能帮我们铲除掉山妖啊。");
	mission_boss_tmp.SetTalkBeing("少侠不要太勉强啊，实在不行就算了吧，我们不会怪你的...");
	mission_boss_tmp.SetTalkDone("少侠真是挽救了我们这个镇啊，我们要拿什么来报答少侠呢。");
	missionBossList.push_back(mission_boss_tmp);
	
	mission_boss_tmp.ClearGiftList();
	mission_boss_tmp.SetID(407);
	mission_boss_tmp.SetName("岸上妖孽");
	mission_boss_tmp.SetInfo("洛阳东北部悬崖有妖孽，需要小心应付。");
	mission_boss_tmp.SetLock(1);
	mission_boss_tmp.SetState(0);
	mission_boss_tmp.SetLevel(5);
	mission_boss_tmp.SetCircle(0);
	mission_boss_tmp.SetGiftType(1);
	mission_boss_tmp.PushGiftList(408);
	mission_boss_tmp.SetUnlockMap(-1);
	mission_boss_tmp.PushBossID(852);
	mission_boss_tmp.SetTalkBefore("城东北部有个非常厉害的秃鹫，专吃人心，如果你能除掉它，你在\
洛阳城的威望必会大幅提升。");
	mission_boss_tmp.SetTalkBeing("还没除掉吗，原来你的实力不过如此.....");
	mission_boss_tmp.SetTalkDone("你居然能杀掉秃鹫，年轻人果然不可貌相啊....");
	missionBossList.push_back(mission_boss_tmp);
	
	mission_boss_tmp.ClearGiftList();
	mission_boss_tmp.SetID(408);
	mission_boss_tmp.SetName("不断失踪的渔民");
	mission_boss_tmp.SetInfo("洛阳城河边的渔民最近一个接一个的失踪，去看看发生什么事了吧。");
	mission_boss_tmp.SetLock(0);
	mission_boss_tmp.SetState(0);
	mission_boss_tmp.SetLevel(8);
	mission_boss_tmp.SetCircle(0);
	mission_boss_tmp.SetGiftType(1);
	mission_boss_tmp.PushGiftList(409);
	mission_boss_tmp.SetUnlockMap(617);
	mission_boss_tmp.PushBossID(853);
	mission_boss_tmp.SetTalkBefore("最近河边的渔民不断失踪，听说是有海怪作怪，你能杀掉秃鹫，说明\
你是个优秀的侠客，你能去调查清楚此事吗？");
	mission_boss_tmp.SetTalkBeing("河边的渔民还在一个一个地失踪，这该怎么办！");
	mission_boss_tmp.SetTalkDone("啊！这次多亏大侠帮助，渔民方能脱身，大侠好身手啊！");
	missionBossList.push_back(mission_boss_tmp);
	
	mission_boss_tmp.ClearGiftList();
	mission_boss_tmp.SetID(409);
	mission_boss_tmp.SetName("最终的决战");
	mission_boss_tmp.SetInfo("随着妖魔不断铲除，只剩下最后的魔界首领，去林中城找到首领，铲除掉它，\
天下方能太平.....");
	mission_boss_tmp.SetLock(0);
	mission_boss_tmp.SetState(0);
	mission_boss_tmp.SetLevel(11);
	mission_boss_tmp.SetCircle(0);
	mission_boss_tmp.SetGiftType(3);
	mission_boss_tmp.PushGiftList(3);
	mission_boss_tmp.PushGiftList(20);
	mission_boss_tmp.SetUnlockMap(619);
	mission_boss_tmp.PushBossID(854);
	mission_boss_tmp.SetTalkBefore("年轻人果然身手不凡，竟能为我城百姓立下如此大功，但仍有一事相求，\
魔界的首领在洛阳南部，至今无人知晓，如果大侠能够到达首领所在地\
并且除掉它，大侠功绩必将流传千古，永垂不朽！");
	mission_boss_tmp.SetTalkBeing("少侠，魔界首领一事就拜托了！");
	mission_boss_tmp.SetTalkDone("少侠的功德天下苍生必将永远铭记！希望少侠还能够继续为民造福！");
	missionBossList.push_back(mission_boss_tmp);
	list<MissionBoss>::iterator itr_msn_boss;
	list<MissionNpc>::iterator itr_msn_npc;
	list<MissionUsing>::iterator itr_msn_using;
	for(itr_msn_boss = missionBossList.begin();
		itr_msn_boss != missionBossList.end();
		++itr_msn_boss)
		missionlist.AddMission(&(*itr_msn_boss));
	for(itr_msn_npc = missionNpcList.begin();
		itr_msn_npc != missionNpcList.end();
		++itr_msn_npc)
		missionlist.AddMission(&(*itr_msn_npc));
	for(itr_msn_using = missionUsingList.begin();
		itr_msn_using != missionUsingList.end();
		++itr_msn_using)
		missionlist.AddMission(&(*itr_msn_using));
	return 0;
}
int GameControl::init_skill(SkillList& skilllist)
{
	Skill skill_tmp;
	skill_tmp.SetName("强力攻击");
	skill_tmp.SetID(200);
	skill_tmp.SetLevel(1);
	skill_tmp.SetPercent(0);
	skill_tmp.SetManaNeed(5);
	skill_tmp.SetAttackPoint(10);
	skill_tmp.SetHealPoint(0);
	skill_tmp.SetDefendPoint(0);
	skilllist.PushSkill(skill_tmp);

	skill_tmp.SetName("自愈");
	skill_tmp.SetID(201);
	skill_tmp.SetLevel(3);
	skill_tmp.SetPercent(1);
	skill_tmp.SetManaNeed(7);
	skill_tmp.SetAttackPoint(0);
	skill_tmp.SetHealPoint(10);
	skill_tmp.SetDefendPoint(0);
	skilllist.PushSkill(skill_tmp);

	skill_tmp.SetName("地震摇山");
	skill_tmp.SetID(202);
	skill_tmp.SetLevel(5);
	skill_tmp.SetPercent(0);
	skill_tmp.SetManaNeed(12);
	skill_tmp.SetAttackPoint(20);
	skill_tmp.SetHealPoint(0);
	skill_tmp.SetDefendPoint(0);
	skilllist.PushSkill(skill_tmp);



	skill_tmp.SetName("医疗波");
	skill_tmp.SetID(205);
	skill_tmp.SetLevel(11);
	skill_tmp.SetPercent(1);
	skill_tmp.SetManaNeed(30);
	skill_tmp.SetAttackPoint(0);
	skill_tmp.SetHealPoint(80);
	skill_tmp.SetDefendPoint(0);
	skilllist.PushSkill(skill_tmp);
	return 0;
}
int GameControl::init_monster(MonsterList& monsterlist)
{
		struct StMonster{
		string name;
		int ID;
		int money;
		int exppoint;
		int hitpoint;
		int attackpoint;
		int defendpoint;
		int lock;
		int die;
		int level;
		/* here is the uslist and wplist ,at most 4 elemetes. */
		int arr_using[4];
		int arr_weapon[4];
	};
	
	Monster monster_tmp;
	int _num_of_monster = sizeof(st_monster)/sizeof(st_monster[0]);
	for(int i = 0;i < _num_of_monster; ++i)
	{
		monster_tmp.MonsterClear();
		monster_tmp.SetName(st_monster[i].name);
		monster_tmp.SetID(st_monster[i].ID);
		monster_tmp.SetMoney(st_monster[i].money);
		monster_tmp.SetExpPoint(st_monster[i].exppoint);
		monster_tmp.SetHitPoint(st_monster[i].hitpoint);
		monster_tmp.SetAttackPoint(st_monster[i].attackpoint);
		monster_tmp.SetDefendPoint(st_monster[i].defendpoint);
		monster_tmp.SetLock(st_monster[i].lock);
		monster_tmp.SetDie(st_monster[i].die);
		monster_tmp.SetLevel(st_monster[i].level);
		for(int j = 0;j < 4; ++j)
			if(st_monster[i].arr_using[j] >= 0)
				monster_tmp.AddUsingList(st_monster[i].arr_using[j]);
			else 
				break;
		for(int j = 0;j < 4; ++j)
			if(st_monster[i].arr_weapon[j] >= 0)
				monster_tmp.AddWeaponList(st_monster[i].arr_weapon[j]);
			else 
				break;

		monsterlist.AddMonster(monster_tmp);
	}
	return 0;
}
int GameControl::init_role(Role& role)
{
	role.Initialize();
	return 0;
}
int GameControl::init_using(UsingList& usinglist)
{
	struct StUsing{
		string name;
		int ID;
		int money;
		int number;
		int addhitpoint;
		int addmanapoint;
		int percentornot;
	};
	

int GameControl::init_weapon(WeaponList& weaponlist)
{
		struct StWeapon{
		string name;
		int ID;
		int money;
		int colour;
		int level;
		int addattackpoint;
		int adddefendpoint;
		int position;
	};
	
	Weapon weapon_tmp;
	int _num_of_weapon = sizeof(st_weapon)/sizeof(st_weapon[0]);
	for(int i = 0;i < _num_of_weapon; ++i)
	{
		weapon_tmp.SetName(st_weapon[i].name);
		weapon_tmp.SetID(st_weapon[i].ID);
		weapon_tmp.SetMoney(st_weapon[i].money);
		weapon_tmp.SetColour(st_weapon[i].colour);
		weapon_tmp.SetAddAttackPoint(st_weapon[i].addattackpoint);
		weapon_tmp.SetAddDefendPoint(st_weapon[i].adddefendpoint);
		weapon_tmp.SetLevel(st_weapon[i].level);
		weapon_tmp.SetPosition(st_weapon[i].position);
		weaponlist.PushWeapon(weapon_tmp);
	}
	return 0;
}
int GameControl::init_npc(NPCList& npclist)
{
		struct StNpc{
		string name;
		string talk;
		int ID;
		int sellornot;
		/* one npc have 5 missions at most! */
		int arr_mission[5];
	};
	
	struct StMap{
		string name;
		int ID;
		int x;int y;
		int lock;
		int level;
		/* the npc and monster at monst ten of them ,
		 * ps: this is the id of elemets.
		 */
		int arr_npc[10];
		int arr_monster[10];
		int arr_must_monster[3];
	};

	StMap st_map[] = {
	 /* name  |id|   x,y|  lock |  lev  | arr_npc --arr_monster---arr_must_monster*/
		{"A地点",601, 0,0,  1,  0, {300,301,302,303,304,305,306,-1,-1,-1},
							 {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1 },
							 {-1,-1,-1} },
		{"B地点",602, 1,0,  1,  0,  {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1 },
							 {800,801,802,-1,-1,-1,-1,-1,-1,-1 },
							 {-1,-1,-1} },
		{"C地点",603, 2,0,  1,  0,  {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1 },
							 {800,801,802,-1,-1,-1,-1,-1,-1,-1 },
							 {-1,-1,-1} },
		{"D地点",604, 2,1,  0,  0,  {307,-1,-1,-1,-1,-1,-1,-1,-1,-1 },
							 {800,801,802,-1,-1,-1,-1,-1,-1,-1 },
							 {-1,-1,-1} },
		
	int _num_of_map = sizeof(st_map)/sizeof(st_map[0]);
	Map map;
	for(int i = 0;i < _num_of_map; ++i)
	{
		map.Clear();
		map.SetName(st_map[i].name);
		map.SetID(st_map[i].ID);
		map.SetPosX(st_map[i].x);
		map.SetPosY(st_map[i].y);
		map.SetLock(st_map[i].lock);
		map.SetLevel(st_map[i].level);
		for(int j = 0; j < 10; ++j)
			if(st_map[i].arr_npc[j]>=0)
				map.AddNPC(st_map[i].arr_npc[j]);
			else
				break;
		for(int j = 0; j < 10; ++j)
			if(st_map[i].arr_monster[j]>=0)
				map.AddMonster(st_map[i].arr_monster[j]);
			else
				break;
		for(int j = 0; j < 3 ; ++j)
			if(st_map[i].arr_must_monster[j]>=0)
				map.AddMonsterMust(st_map[i].arr_must_monster[j]);
			else
				break;
		maplist.PushMap(map);
	}
	maplist.SetPointer();
	return 0;
}
int GameControl::game_init(Role& role,MapList& maplist,
		MonsterList& monsterlist,UsingList& usinglist,
		WeaponList& weaponlist,MissionList& missionlist,
		NPCList& npclist,SkillList& skilllist,Battle& battle)
{
	
	system("cls");
	cout<<endl<<"     载入中.";
	
	init_mission(missionlist);cout<<'.';//Sleep(100);
	init_skill(skilllist);cout<<'.';//Sleep(100);
	init_monster(monsterlist);cout<<'.';//Sleep(100);
	init_role(role);cout<<'.';//Sleep(100);
	init_using(usinglist);cout<<'.';//Sleep(100);
	init_weapon(weaponlist);cout<<'.';//Sleep(100);
	init_npc(npclist);cout<<'.';//Sleep(100);
	init_map(maplist);cout<<'.';//Sleep(/100);
	
	return 1;
};
int GameControl::game_save(){return 1;};
int GameControl::game_load(){return -1;};
/* this function is the mail loop of the game, in
 * this function, there will be a while() loop that
 * stands for the main-of-game. It will return some
 * values to tell us the manu of the user select.
 *
 * The values that returned:
 * 		GAME_SAVE
 * 		GAME_LOAD
 * 		GAME_INIT
 * 		GAME_EXIT 
 */
int GameControl::game_control(Role& role,MapList& maplist,
		MonsterList& monsterlist,UsingList& usinglist,
		WeaponList& weaponlist,MissionList& missionlist,
		NPCList& npclist,SkillList& skilllist,Battle& battle)
{
	/* the user input in this function */
	string userinput;
	string userinput_1;
	string userinput_2;
	/* the number of npcs + monsters in curmap.*/
	int num_in_map = 0;
	/* first of all,we must generate the first map of all,
	 * because when we in the while() loop, only when role 
	 * change map can we generate a new map!
	 */
	//if(init_time == 1)
	{
		maplist.SetCurMap();
		maplist.Generate(role,monsterlist);
		
		/* set the init_time to 1.*/
		init_time = 1;
	}
	while(true)
	{
		role.PrintHead();
		maplist.PrintMap(npclist,monsterlist);
		/* print menu.*/
		ext_print_line();
		num_in_map = maplist.GetMonsterNum() + maplist.GetNPCNum();
		cout<<"1~"<<num_in_map<<"选择 0:菜单"<<endl;
		ext_print_line();
		/* input loop*/
		while(true)
		{
			cin>>userinput;
			if(userinput[0] == '0')
				break;
			if(userinput[0]-'0'>=1&&userinput[0]-'0'<=num_in_map)
				break;
			if(userinput[0] == 'w'||userinput[0] == 'W')/* change map*/
				break;
			if(userinput[0] == 's'||userinput[0] == 'S')/* change map*/
				break;
			if(userinput[0] == 'a'||userinput[0] == 'A')/* change map*/
				break;
			if(userinput[0] == 'd'||userinput[0] == 'D')/* change map*/
				break;
			if(userinput[0] == 'b'||userinput[0] == 'B')/* beg */
				break;
			if(userinput[0] == 'k'||userinput[0] == 'K')/* skill*/
				break;
			if(userinput[0] == 'm'||userinput[0] == 'M')/* map*/
				break;
			if(userinput[0] == 'q'||userinput[0] == 'Q')/* mission*/
				break;
			if(userinput[0] == 'c'||userinput[0] == 'C')/* infomation*/
				break;
		}
		if(userinput[0] == '0')
		{
			/* when game_menu() return a -1 ,it means user want to go back
			 * to the main menu, thus game_control should be exit.
			 */
			if(game_menu(role,maplist,monsterlist,usinglist,
					weaponlist,missionlist,npclist,skilllist)==-1)
				return 0;
		}
		else if(userinput[0]-'0'>=1&&userinput[0]-'0'<=num_in_map)
		{
			if(userinput[0]-'0'<=maplist.GetNPCNum())
			{
				(*(npclist.GetNPCPtr(
					maplist.GetNPCID(userinput[0]-'0')))).Talk(
					   role, usinglist,weaponlist,missionlist,
					   skilllist,monsterlist,maplist);
			}
			else
			{
				int temp_index = userinput[0] - '0' - maplist.GetNPCNum();
				/* the find the monster */
				Monster monster_selected = maplist.GetMonster(temp_index); 
				/* then generate the monster according to the role's level.*/
				monster_selected.Generate(role.GetLevel());
				battle.InBattle(role,monster_selected,monsterlist);
				battle.AfterBattle(role,monster_selected,usinglist,weaponlist,skilllist);
			}
		}
		else if(userinput[0] == 'w'||userinput[0] == 'W')/* change map*/
			if(maplist.ChangeMap(MAP_NORTH,role))
				maplist.Generate(role,monsterlist);
			else
				;
		else if(userinput[0] == 's'||userinput[0] == 'S')/* change map*/
			if(maplist.ChangeMap(MAP_SOUTH,role))
				maplist.Generate(role,monsterlist);
			else
				;
		else if(userinput[0] == 'a'||userinput[0] == 'A')/* change map*/
			if(maplist.ChangeMap(MAP_WEST,role))
				maplist.Generate(role,monsterlist);
			else
				;
		else if(userinput[0] == 'd'||userinput[0] == 'D')/* change map*/
			if(maplist.ChangeMap(MAP_EAST,role))
				maplist.Generate(role,monsterlist);
			else
				;
		else if(userinput[0] == 'b'||userinput[0] == 'B')/* beg */
			role.PrintBeg();
		else if(userinput[0] == 'k'||userinput[0] == 'K')/* skill*/
			role.PrintSkill();
		else if(userinput[0] == 'm'||userinput[0] == 'M')/* map*/
			maplist.ShowMap();
		else if(userinput[0] == 'q'||userinput[0] == 'Q')/* mission*/
			role.PrintMission(missionlist,usinglist,monsterlist,npclist);
		else if(userinput[0] == 'c'||userinput[0] == 'C')/* infomation*/
			role.PrintInfo();
	}
	return 1;
}
/* when return -1,then this game will exit. */
int GameControl::game_menu(Role& role , MapList& maplist, MonsterList& monsterlist,
				 UsingList& usinglist, WeaponList& weaponlist,
				 MissionList& missionlist,NPCList& npclist,SkillList& skilllist)
{

	return -1;
}
/* this function is the print_game, when we first come to this game,this function 
 * will work.
 * To give a view of the menu of game.
 */
int GameControl::print_game()
{
	string select_menu;
	while(1)
	{
		system("cls");
		/* to print the game menu */
		cout<<endl<<"    人魔之战       ver 1.0"<<endl;
		cout<<endl<<"1: 新游戏"<<endl<<"2: 载入游戏（尚未添加）"<<endl<<
		"3: 游戏帮助"<<endl<<"4: 制作信息"<<endl<<"5: 退出"<<endl;
		cout<<endl<<"请选择（~5）:"<<endl;
		cin>>select_menu;
		if(select_menu[0] == '1') return GAME_NEW;
		else if(select_menu[0] == '2') return GAME_LOAD;
		else if(select_menu[0] == '3') return GAME_INFO;
		else if(select_menu[0] == '4') return GAME_MY;
		else if(select_menu[0] == '5') return GAME_EXIT;
	}
	return 0;
}
int GameControl::print_txt(char* filename)
{
	fstream file_info(filename);
	char read[80];
	system("cls");
	while(!file_info.eof())
	{
		file_info>>read;
		cout<<read<<endl;
	}
	file_info.close();
	ext_print_line();
	cout<<"1:确定"<<endl;
	while(1)
	{
		cin>>read;
		if(read[0] == '1')
			break;
	}
	return 0;
}
int GameControl::my_game()
{
	print_txt("my_info.txt");
	return 0;
}
int GameControl::game_info()
{
	print_txt("game_info.txt");
	return 0;
}
/****************************************************
 *				MAIN.CPP
 *  This is the main file of this game.
 *  
 *	lvpengms   2009-09-29
 ****************************************************/

#include"gamecontrol.h"
int main()
{
	Role role;
	MapList map_list;
	SkillList skill_list;
	MonsterList monster_list;
	MissionList mission_list;
	UsingList using_list;
	WeaponList weapon_list;
	NPCList npc_list;
	Battle battle;
	GameControl game_control; 
	srand(unsigned(time(NULL)));
	/* the value that print_game() returned.
	 */
	int main_menu;
	/* init game*/
	game_control.game_init(role,map_list,monster_list,
			using_list,weapon_list,mission_list,
			npc_list ,skill_list,battle);
	while(true)
	{
		/* print the main game.
	 	*   new game
	 	*   load game
	 	*   info game;
	 	*   exit game;
	 	*/
		main_menu=game_control.print_game(); /* get user choice */
		/* if load game,then load
	 	* and if no save,return a -1.
	 	*/
		if(main_menu == GAME_LOAD)
			if(game_control.game_load() == -1)
			{
				cout<<"没有进度可以读取!!!"<<endl;
				Sleep(1500);
				continue;
			}else
				continue;
		else if(main_menu == GAME_NEW)
		{
			/* here we should init all the data of game !
			game_control.game_init(role,map_list,monster_list,
			using_list,weapon_list,mission_list,
			npc_list ,skill_list,battle);*/
		}
		else if(main_menu == GAME_EXIT) 
		{

			break;    /* exit the while loop,game will exit.*/
		}
		else if(main_menu == GAME_INFO)
		{
			/* print info of the game.*/
			game_control.game_info();
			continue;
		}
		else if(main_menu == GAME_MY)
		{
			game_control.my_game();
			continue;
		}
		/* get in the main loop of game.
		 * When this function completed ,it means that user
		 * go back to the main menu of the game. 
		 * new ,load,info,exit game.
		 */
		game_control.game_control(role,map_list,monster_list,
			using_list,weapon_list,mission_list,
			npc_list ,skill_list,battle);
	}
	/* here, the game exit!*/
	return 0;
}